package top.anydata.lifeofcode.lifesystem.service.third.impl;

import com.wechat.pay.java.service.payments.nativepay.NativePayService;
import com.wechat.pay.java.service.payments.nativepay.model.PrepayRequest;
import com.wechat.pay.java.service.payments.nativepay.model.PrepayResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.anydata.lifeofcode.lifesystem.service.third.IWechatService;
import com.wechat.pay.java.service.payments.nativepay.model.Amount;

/**
 * 功能描述:
 *
 * @author <a href="mailto:caingao@anydata.top">CainGao</a>
 * @version V_1.0
 * @date 2024/2/4 5:19 PM
 */
@Service
public class WechatServiceImpl implements IWechatService {

//    @Autowired
//    NativePayService nativePayService;
//
//    @Override
//    public void wechatPayPrepay(Integer amountNum) {
//        PrepayRequest request= new PrepayRequest();
//        Amount amount = new Amount();
//        amount.setTotal(amountNum);
//        request.setAmount(amount);
//        request.setAppid("wxa9d9651ae******");
//        request.setMchid("190000****");
//        request.setOutTradeNo("1217752501201407033233368018");
//        request.setDescription("Image形象店-深圳腾大- QQ公仔");
//        request.setNotifyUrl("https://www.weixin.qq.com/wxpay/pay.php");
//        request.setOutTradeNo("out_trade_no_001");
//        // 调用下单方法，得到应答
//        PrepayResponse response = nativePayService.prepay(request);
//        System.out.println(response.getCodeUrl());
//    }

}
